<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="btn">点击反解析search</button>
    <script>
      var btnEle = document.getElementById("btn");
      btnEle.onclick = function () {
        var obj = { name: "wqz", age: 25, height: "168cm" };
        var str = "?";
        for (var key in obj) {
          str = str + key + ":" + obj[key] + "&";
        }
        str = str.replaceAll(":", "=").substring(0, str.length - 1);
        // console.log(str);
        window.location.href = `SEarch.html${str}`;
      };
    </script>
  </body>
</html>
